Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Enhancing Movie Playback Performance


LoadTrackIntoRam

The LoadTrackIntoRam function loads a track's data into memory. If the track does not fit, the function returns an error.

pascal OSErr LoadTrackIntoRam (Track theTrack, TimeValue time, 
                               TimeValue duration, long flags);
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack (described on page 2-136 and page 2-188, respectively).
time
Allows you to specify a portion of the track to load. The time parameter contains the starting time of the track segment to load. The duration parameter specifies the length of the segment to load. You must specify this time value in the movie's time coordinate system.
duration
Allows you to specify a portion of the track to load. The time parameter contains the starting time of the track segment to load. The duration parameter specifies the length of the segment to load. You can use the GetTrackDuration function (described on page 2-176) to determine the length of the entire movie. Note that the media handler may load more data than you specify.
flags
Gives you explicit control over what is loaded into memory and how long to keep it around. The following constants are provided:
            enum 
            {
               keepInRam = 1<<0,
               unkeepInRam = 1<<1,
               flushFromRam = 1<<2,
               loadForwardTrackEdits = 1<<3,
               loadBackwardTrackEdits = 1<<4
            };
You can set these flags in any combination that makes sense. For descriptions of the individual flag constants, see the description of the LoadMovieIntoRam function on page 2-125.
ERROR CODES
invalidTrack-2009This track is corrupted or invalid
invalidDuration-2014This duration value is invalid
invalidTime-2015This time value is invalid
progressProcAborted-2019Your progress function returned an error
File Manager errors
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996